<?php 

class Issued extends CI_Controller {

    function __construct() {
        parent::__construct();
        if ($this->session->userdata('logged_in')) {
            $session_data = $this->session->userdata('logged_in');
            $data['username'] = $session_data['username'];
        } else {
            redirect('login/costumer', 'refresh');
        }
        $this->load->model('costumer');
        $this->load->model('issued');
//        $this->load->model('berita');
        $this->load->model('rute');
//        $this->load->model('jadwal');
        $this->load->model('airline');
        $this->load->model('deposit');
        $this->load->model('departure');
        $this->load->helper('deposit_helper');
        $this->load->helper('user_helper');
    }

    function index() {
        $id = $this->id();
        $data['id'] = $id;
        $data['news'] = $this->berita->index();
        $data['book_count'] = $this->costumer->book_hitung($id);
        $data['issued_count'] = $this->costumer->issued_hitung($id);
        $data['rows'] = $this->costumer->index($id);
        $data['deposits'] = $this->deposit->index($id);
        $data['options'] = $this->rute->get_array();
        $data['maskapai'] = $this->airline->get_array();
        $data['content'] = 'costumers/index';
//        $this->load->view('template/costumer', $data);
        $this->load->view('template/costumer', $data);
    }
    
}